class Solution {
    //2446 - 判断两个时间是否存在冲突
    public boolean haveConflict(String[] event1, String[] event2) {
        return !(event1[1].compareTo(event2[0])<0
                ||event2[1].compareTo(event1[0])<0);
        //时间是可以用字符串来比较的！！！
    }
}

class Solution1 {
    //367 - 有效的完全平方数
    public boolean isPerfectSquare(int num) {
        if(num == 1) return true;
        for(int i=1; i<=num/2;i++){
            int sum = i*i;
            if(sum == num){
                return true;
            }
            if(sum>num){
                break;
            }
        }
        return false;
    }
}
class Solution2 {
    public boolean isPerfectSquare(int num) {
        int left = 0, right = num;
        while(left <= right){
            int mid = (right - left)/2+left;
            long mul = (long)mid*mid;
            if(mul == num){
                return true;
            }else if(mul > num){
                right = mid - 1;
            }else{
                left = mid + 1;
            }
        }
        return false;
    }
}
public class Test {

}
